package cn.jantd.modules.task.controller;

import cn.jantd.core.api.vo.Result;
import cn.jantd.modules.task.entity.CompanyInfo;
import cn.jantd.modules.task.service.ILeadCompanyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ProjectName: trial-training-flow-boot-parent
 * @Package: cn.jantd.modules.task.controller
 * @ClassName: LeadCompanyController
 * @Author: admin
 * @Description:
 * @Date: 2020/7/11 15:56
 * @Version: 1.0
 */
@RestController
@RequestMapping("/sys/company")
@Slf4j
public class LeadCompanyController {
    @Autowired
    ILeadCompanyService leadCompanyService;

    /*
     * 牵头单位
     * */
    @ResponseBody
    @GetMapping(value = "allLeadCompany")
    public Object allLeadCompany() {
        Result<List<CompanyInfo>> result = new Result<List<CompanyInfo>>();

        List leadCompanyList = leadCompanyService.list();

        result.setSuccess(true);
        result.setResult(leadCompanyList);
        return result;
    }
}
